from django.shortcuts import render
from index.models import CommonTables


def index(request):
    query = {'stars__gt': 3}
    q_result = CommonTables.objects.filter(**query)
    return render(request, 'index.html', locals())


def show(request):
    content = request.POST.get('query')
    query = {'commons__contains': content}
    q_result = CommonTables.objects.filter(**query)
    return render(request, 'show.html', locals())
